module.exports = function ($scope, $state, $resource, $modal, toaster, $stateParams,code){
    // var code = $stateParams.code;
    
    $scope.tourinfo = function (){
        console.log(code);
       
        $resource('/api/as/goc/tourbase/getBase', {}, {}).save({'code': code},function (res) {

        if (res.errcode !== 0) {
            alert("暂无游团基本信息");
            return;
        }
        $scope.info = res.data;
        

        });
    }
    
    $scope.tourinfo();

    $scope.tourbase = function (){
        console.log(code);
       
        $resource('/api/as/goc/tourbase/getInfo', {}, {}).save({'code': code},function (res) {

        if (res.errcode !== 0) {
            alert("暂无游团团期信息");
            return;
        }
        $scope.tourbase = res.data;
        
        if($scope.tourbase.departure_mode = '0'){
            $scope.tourbase.departure_mode_name = '飞机'
        }else if($scope.tourbase.departure_mode = '1'){
            $scope.tourbase.departure_mode_name = '火车'
        }else if($scope.tourbase.departure_mode = '2'){
            $scope.tourbase.departure_mode_name = '轮船'
        }else if($scope.tourbase.departure_mode = '3'){
            $scope.tourbase.departure_mode_name = '汽车'
        }else if($scope.tourbase.departure_mode = '4'){
            $scope.tourbase.departure_mode_name = '无'
        }

        if($scope.tourbase.return_mode	 = '0'){
            $scope.tourbase.return_mode_name = '飞机'
        }else if($scope.tourbase.return_mode	 = '1'){
            $scope.tourbase.return_mode_name = '火车'
        }else if($scope.tourbase.return_mode	 = '2'){
            $scope.tourbase.return_mode_name = '轮船'
        }else if($scope.tourbase.return_mode	 = '3'){
            $scope.tourbase.return_mode_name = '汽车'
        }else if($scope.tourbase.return_mode	 = '4'){
            $scope.tourbase.return_mode_name = '无'
        }
        });
    }
    
    $scope.tourbase();

    $scope.tourprice = function (){
        console.log(code);
       
        $resource('/api/as/goc/tourbase/getPrice', {}, {}).save({'code': code},function (res) {

        if (res.errcode !== 0) {
            alert("暂无游团价格信息");
            return;
        }
        $scope.tourprice = res.data;
        
        if($scope.tourprice.departure_mode = '0'){
            $scope.tourprice.departure_mode_name = '飞机'
        }else if($scope.tourprice.departure_mode = '1'){
            $scope.tourprice.departure_mode_name = '火车'
        }else if($scope.tourprice.departure_mode = '2'){
            $scope.tourprice.departure_mode_name = '轮船'
        }else if($scope.tourprice.departure_mode = '3'){
            $scope.tourprice.departure_mode_name = '汽车'
        }else if($scope.tourprice.departure_mode = '4'){
            $scope.tourprice.departure_mode_name = '无'
        }

        
        });
    }
    
    $scope.tourprice();
    
    
    




};